home *** CD-ROM | disk | FTP | other *** search
- /*
- ** Program: BTNC
- **
- ** Module: Utility functions
- */
-
- #include <portab.h>
- #include <ctype.h>
- #include <string.h>
-
- #include "general.h"
-
- VOID CleanString(BYTE *source, BYTE *dest)
- {
- while (*source)
- {
- if (!isspace(*source) &&
- !(*source == '\n')) *dest++ = *source;
-
- source++;
- }
-
- *++dest = EOS;
- }
-
- VOID ReplaceUnderscores(BYTE *string)
- {
- while (*string)
- {
- if (*string == '_') *string = ' ';
- string++;
- }
- }
-
- BYTE *NextField(BYTE *start, BYTE *dest)
- {
- BYTE *runptr = start;
-
- while ((*runptr) && (*runptr != ',')) *dest++ = *runptr++;
- *dest = EOS;
-
- if (!*runptr)
- return (NULL);
- else
- return(++runptr);
- }
-
- VOID CodeSystemEntry (SYSTEM *sys, CSYSTEM *tmp)
- {
- BYTE *s = tmp->code;
-
- tmp->hubnode = sys->hubnode;
- tmp->maxbaud = sys->maxbaud;
- tmp->modemtype = sys->modemtype;
- tmp->flags = sys->flags;
-
- strcpy (s, sys->sysname);
- Last(s) = Last(s) | HB;
- strcat (s, sys->location);
- Last(s) = Last(s) | HB;
- strcat (s, sys->operator);
- Last(s) = Last(s) | HB;
- strcat (s, sys->phone);
- Last(s) = Last(s) | HB;
-
- tmp->length = 10 + (UWORD)strlen(s);
- }
-